﻿@section head{
    
}
<div class="zb-flex-1 zb-flex zb-flex-column zb-w">
    <div class="zb-query-frame">
        <%for(var i = 0; i < query_fields.length; i++) {%>
        <div class="query-block">
            <span><%=query_fields[i].column_comment%>：</span>
            <el-input placeholder="请输入<%=query_fields[i].column_comment%>"
                      v-model="query.<%=hcCore.toSmallHump(query_fields[i].column_name)%>"
                      size="mini">
            </el-input>
        </div>
        <%}%>
        <div class="query-block">
            <el-button type="primary"
                       icon="el-icon-search"
                       @@click="onQuery"
                       v-if="buttons.hasQuery"
                       size="mini">查询</el-button>
            <el-button type="success"
                       icon="el-icon-s-promotion"
                       @@click="onExport"
                       v-if="buttons.hasExport"
                       size="mini">导出</el-button>
        </div>
    </div>
    <div class="zb-func-frame">
        <el-button :icon="button.act_icon"
                   :key="button.act_no"
                   @@click="handleButton(button.act_no)"
                   v-for="button in buttons.topOp"
                   size="mini">
            <span v-text="button.act_name"></span>
        </el-button>
    </div>
    <el-table :data="tableData.records"
              height="250"
              border
              class="zb-border-no"
              ref="tblRecords"
              style="width: 100%"
              size="mini">
        <el-table-column type="selection"
                         class-name="table-checkbox-th"
                         width="45"
                         align="center"
                         fixed="left">
        </el-table-column>
        <el-table-column type="index"
                         width="50"
                         align="center"
                         title="序号"
                         :index="recordIndex"
                         fixed="left">
        </el-table-column>
        <%for(var i = 0; i < fields.length; i++) {%>
        <el-table-column prop="<%=fields[i].column_name%>"
                         label="<%=fields[i].column_comment%>"
                         <%if (i<fields.length-1) {%>width="180"<%}%>>
        </el-table-column>
        <%}%><el-table-column fixed="right"
                             label=" "
                             width="90">
                <template slot-scope="scope">
                    <el-button :icon="button.act_icon"
                               :key="button.act_no"
                               @@click="handleButton(button.act_no, scope.row)"
                               v-for="button in buttons.rowOp"
                               circle
                               size="mini">
                    </el-button>
                </template>
            </el-table-column>
    </el-table>
    <el-pagination background
                   layout="prev, pager, next, jumper, total"
                   :page-size="query.pageSize"
                   :total="tableData.total"
                   @@current-change="onPageChange">
    </el-pagination>
    <zb-edit :options="edit" ref="edit"></zb-edit>
</div>
@section script{
    <script src="~/module/common/form.template.js"></script>
    <script src="~/module/projects/<%=model_name.toLowerCase().replace(/^tbl/,'').replace(/_/ig,'')%>.index.js" asp-append-version="true"></script>
}
